#ifndef DIRECTORY_H
#define DIRECTORY_H

#include "files/file.h"
#include "files/file_item.h"

#include <vector>

namespace Tvimeg
{
	class Directory : public FileItem
	{
	public:
		Directory(void);
		Directory(const FilePath& pathIn);

		typedef std::vector<Directory>	DirectoryList;
		typedef std::vector<File>		FileList;

		bool			Exists(void) const;

		std::string		GetName(void) const;

		bool			GetDirectories(DirectoryList& directories) const;
		bool			GetFiles(FileList& files) const;

		File			GetRelativeFile(const FilePath& path) const;
		Directory		GetRelativeDirectory(const FilePath& path) const;

	private:
		template<class Process>
		bool			ScanDirectory(Process processor) const;
	};
}

#endif // DIRECTORY_H
